<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>好运网</title>
</head>

<body th:fragment="header">
<link rel="stylesheet" href="css/basic.css"/>
<link rel="stylesheet"  href="css/style.css"/>
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css"/>
<script src="js/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/limonte-sweetalert2/6.11.1/sweetalert2.all.min.js"></script>
<script src="js/common.js"></script>

<div class="top">
    <div class="warp">

        <div class="top-01" ><span th:text="'GMT+8  '+${#ctx.servletContext.getAttribute('currentTime')}"></span> <br/>
            <a href="/helpcenter">常见问题</a>丨<a href="helpcenter">新手指南</a></div>
        <div class="top-02 fl" th:if="${ #lists.isEmpty(session.loginSession)}">
            <form id="loginForm">
                <input type="text" name="userName" class="user fl m15r" placeholder="用户名"/>
                <div class="user fl">
                    <input type="password" name="password" class="pass"/>
                    <a class="fr fs14" href="forgotpasswordone">忘记?</a></div>
                <a class="login m20l" id="loginSubmit" href="#">登陆</a> <a class="rentk m15l" href="/registerView">注册</a>
            </form>
        </div>

        <div class="top-02-login fl"  th:if="${session.loginSession}">

            <span><a href="deposit"><p class="fl" th:text="${session.loginSession.userName}"></p><img align="middle" class="m5l m20t m5r fl" width="20" src="images/zzb.png" /><p class="fl" th:text="'LV'+${session.loginSession.getUserLevel()}">LV1</p>
            </a></span>
            <p class="znx"><a style="color:#fff;" href="systemMessageReceive">站内信</a>
            <i th:if="${session.unreadMessageNumber>0}" th:text="${session.unreadMessageNumber}"></i>
        </p>  <span><a href="/deposit">账户中心</a><br />
</span> <span class="fl"><a  href="logout">退出<img src="images/ico25.png" /></a></span>

        </div>

        <div class="top-03 fl"><a href="http://wpa.qq.com/msgrd?v=3&uin=800022936&site=qq&menu=yes" target="_blank"><img src="images/hyw-02.png"/>在线客服</a></div>
    </div>
</div>
<div class="navbg">
    <div class="warp">
        <div class="logo"><a href="index"><img src="images/logo.jpg" /></a></div>
        <ul class="nav fr">
            <li class="crent"><a href="#">体育投注<br />
                <span>Sports betting</span></a></li>
            <li><a href="#">真人娱乐<br />
                <span>Live Casio</span></a></li>
            <li><a href="#">快乐彩<br />
                <span>keno</span></a></li>
            <li><a href="#">捕鱼王<br />
                <span>Fishing King</span></a></li>
            <li><a href="#">老虎机<br />
                <span>slote machine</span></a></li>
            <li><a href="#">优惠活动<br />
                <span>special offer</span></a></li>
            <li><a href="#">手机投注<br />
                <span>Mobile betting</span></a></li>
        </ul>
    </div>
</div>

<script>
    $("#loginSubmit").click(function () {
        var userName = $("input[name='userName']").val();
        var password = $("input[name='password']").val();
        if(userName.length ==0){
            alertWorning("用户名 或者 密码不能为空!");
            return;
        }

        $.ajax({
            method: "POST",
            url: "/loginSubmit",
            data: $("#loginForm").serializeArray(),
            dataType: "json"
        }).done(function (msg) {
            if (msg.status == 'success') {
                window.location.href = '/deposit';
            } else {
                alertWorning(msg.data);
            }
        });
    })

</script>



</body>
</html>
